/*
 * @Author: Song Xinxin
 * @Date: 2022-10-30 15:48:47
 * @LastEditors: Song Xinxin
 * @LastEditTime: 2022-11-03 10:26:17
 * @FilePath: \WYW_0419_Oasis\JavaScripts\Modules\PlayerAttr\Data_PlayerAttr.ts
 * @Description: 玩家属性模块数据
 * 
 * Copyright (c) 2022 by error: git config user.name && git config user.email & please set dead value or install git, All Rights Reserved. 
 */
import { DataInfo, ModuleData } from "odin";

//玩家属性
export class DataInfo_PlayerAttr extends DataInfo
{
    Name:string;//玩家昵称
    HP:number;//血量
    kill:number;//击杀数
    death:number;//死亡数
    count:number;//收集物数量
}

//玩家属性模块数据
export class Data_PlayerAttr extends ModuleData<DataInfo_PlayerAttr>
{
    public constructor()
    {
        super(DataInfo_PlayerAttr);
    }

    /**
     * 设置玩家昵称
     * @param name 
     */
    public setName(name:string)
    {
        this.dataInfo.Name = name;
    }

    /**
     * 获取当前玩家昵称
     */
    public get getName()
    {
        return this.dataInfo.Name;
    }


    /**
     * 设置血量
     * @param hp 
     */
    public setHP(hp:number)
    {
        this.dataInfo.HP = hp;
    }

    /**
     * 获取当前血量
     */
    public get getHP()
    {
        return this.dataInfo.HP;
    }

    /**
     * 减少血量
     * @param hp 
     */
    public subHP(hp:number)
    {
        this.dataInfo.HP = this.dataInfo.HP - hp;
    }






    /**
     * 设置击杀数
     * @param kill 
     */
    public setkill(kill:number)
    {
        this.dataInfo.kill = kill;
    }

    /**
     * 获取当前击杀数
     */
    public get getkill()
    {
        return this.dataInfo.kill;
    }

    /**
     * 增加击杀数
     * @param kill 
     */
    public addkill(kill:number)
    {
        this.dataInfo.kill = this.dataInfo.kill + kill;
    }




    /**
     * 设置死亡数
     * @param death 
     */
    public setdeath(death:number)
    {
        this.dataInfo.death = death;
    }

    /**
     * 获取当前死亡数
     */
    public get getdeath()
    {
        return this.dataInfo.death;
    }

    /**
     * 增加死亡数
     * @param death 
     */
    public adddeath(death:number)
    {
        this.dataInfo.death = this.dataInfo.death + death;
    }




    /**
     * 设置收集物数量
     * @param count 
     */
    public setcount(count:number)
    {
        this.dataInfo.count = count;
    }

    /**
     * 获取当前收集物数量
     */
    public get getcount()
    {
        return this.dataInfo.count;
    }

    /**
     * 增加收集物数量
     * @param count 
     */
    public addcount(count:number)
    {
        this.dataInfo.count = this.dataInfo.count + count;
    }

}